//
//  SubscriptionCell.m
//  ksjv2
//
//  Created by mac on 15/1/8.
//  Copyright (c) 2015年 CnbizMedia. All rights reserved.
//

#import "SubscriptionCell.h"
#import "Util.h"
@implementation SubscriptionCell

- (void)oneButton:(id)sender {
    self.Money=@"1";
    [self selectButton];
    self.oneButton.backgroundColor=[UIColor whiteColor];
    [self.oneButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [self.oneButton setBackgroundImage:[UIImage imageNamed:@"subyes"] forState:UIControlStateNormal];
}
- (void)sixButton:(id)sender {
    self.Money=@"6";
    [self selectButton];
    self.sixButton.backgroundColor=[UIColor whiteColor];
    [self.sixButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [self.sixButton setBackgroundImage:[UIImage imageNamed:@"subyes"] forState:UIControlStateNormal];
}
- (void)TwelveButton:(id)sender {
    self.Money=@"12";
    [self selectButton];
    self.TwelveButton.backgroundColor=[UIColor whiteColor];
    [self.TwelveButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [self.TwelveButton setBackgroundImage:[UIImage imageNamed:@"subyes"] forState:UIControlStateNormal];
}

-(void)selectButton{
    self.oneButton.backgroundColor=UIColorFromRGB(0x8487ba);
    self.sixButton.backgroundColor=UIColorFromRGB(0x8487ba);
    self.TwelveButton.backgroundColor=UIColorFromRGB(0x8487ba);
    
    [self.oneButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.sixButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.TwelveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    
    [self.oneButton setBackgroundImage:nil forState:UIControlStateNormal];
    [self.TwelveButton setBackgroundImage:nil forState:UIControlStateNormal];
    [self.sixButton setBackgroundImage:nil forState:UIControlStateNormal];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    
    [super setSelected:selected animated:animated];
    /*
    float size = self.frame.size.width/3-5;
    self.oneButton =[UIButton buttonWithType:UIButtonTypeCustom];
    [self.oneButton setFrame:CGRectMake(15, 165, size-15, 25)];
    [self.oneButton setFont:[UIFont systemFontOfSize:15]];
    [self.oneButton setTitle:@"6元/期" forState:UIControlStateNormal];
    [self.oneButton setTag:6];
//    [self.oneButton addTarget:self action:@selector(oneButton:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.oneButton];
    self.sixButton =[UIButton buttonWithType:UIButtonTypeCustom];
    [self.sixButton setFrame:CGRectMake(15+size, 165, size-15, 25)];
    [self.sixButton setFont:[UIFont systemFontOfSize:15]];
    [self.sixButton setTitle:@"30元/半年" forState:UIControlStateNormal];
    [self.sixButton setTag:30];
//    [self.sixButton addTarget:self action:@selector(sixButton:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.sixButton];
    self.TwelveButton =[UIButton buttonWithType:UIButtonTypeCustom];
    [self.TwelveButton setFrame:CGRectMake(15+size*2, 165, size-15, 25)];
    [self.TwelveButton setFont:[UIFont systemFontOfSize:15]];
    [self.TwelveButton setTitle:@"50元/年" forState:UIControlStateNormal];
    [self.TwelveButton setTag:50];
//    [self.TwelveButton addTarget:self action:@selector(TwelveButton:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.TwelveButton];
     
    
//    self.Money=@"1";
    [self selectButton];
//    self.oneButton.backgroundColor=[UIColor whiteColor];
//    [self.oneButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
//    [self.oneButton setBackgroundImage:[UIImage imageNamed:@"subyes"] forState:UIControlStateNormal];
    // Configure the view for the selected state
     */
}

@end
